USE [OT]
GO
/****** Object:  StoredProcedure [dbo].[selctedQue]    Script Date: 9/25/2014 11:41:36 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create PROCEDURE [dbo].[SelctedQuestionList] @SubjectID INT,@TopicID INT,@TestID INT
AS
select Questions.QuestionID,QuestionName,iif(TestQuestions.QuestionID is null,'','checked') as IsSelectedQuestion 
from Questions 
left join TestQuestions on Questions.QuestionID=TestQuestions.QuestionID 
and TestID=@TestID where TopicID=@TopicID and SubjectID=@SubjectID
